import { TRoute } from "../typings";

export const staticRoutes: TRoute.MenuPropsList = [{
    path: '/',
    name: 'home',
    component: () => import('@/layout/index.vue'),
    redirect: '/index.html',
    meta: {
        title: '首页'
    },
    children: [{
        path: 'index.html',
        name: 'home-index',
        meta: {
            title: '首页'
        },
        component: () => import('@/view/HomeIndex/index.vue')
    },{
        path: 'lst',
        name: 'home-lst',
        component: () => import('@/view/HomeIndex/index.vue'),
        meta:{
            title: '列表页'
        }
    },{
        path:"roles",
        name:"roles",
        redirect: '/roles/list',
        meta: {
            title: '角色管理'
        },
        children:[{
            path: 'list',
            name: 'roles-list',
            component: () => import('@/view/Roles/index.vue'),
            meta: { 
                title: '角色列表'
            }
        }]
    },{
        path: "error/:code",
        name: "error",
        component: () => import("@/view/Error/index.vue"),
        meta: {
            isHide: true
        }
    }]
},{
    path: '/users',
    component:  () => import('@/layout/index.vue'),
    redirect: '/users/list',
    meta:{
        title: '用户管理'
    },
    children:[{
        path: 'list',
        name: 'users-list',
        component: () => import('@/view/Users/index.vue'),
        meta: {
            title: '用户列表'
        }
    },{
        path: 'detail/:id',
        name: 'users-detail',
        component: () => import('@/view/Users/detail.vue'),
        meta: {
            title: '用户详情'
        }   
    },{
        path: 'create',
        name: 'users-create',
        component: () => import('@/view/Users/create.vue'),
        meta: {
            title: '创建用户'
        }   
    }]
}
,{
    path: '/login',
    name: 'login',
    component: () => import('@/view/Login/index.vue'),  
    meta: {
        isHide: true
    }
},{
    // Resolve refresh page, route warnings
    path: "/:pathMatch(.*)*",
    redirect: "/error/404",
    meta: {
        isHide: true
    }
}]
